﻿#ifndef DATAPACKAGE_H
#define DATAPACKAGE_H

#include <QObject>

class QSqlQuery;
class DataPackage : public QObject
{
	Q_OBJECT

public:
	DataPackage(QObject *parent = 0);
	~DataPackage();

public:
	QString getError();

public:
	bool response(QSqlQuery & query, QJsonObject & data);
	void response(const QString & strMsg, bool bError, QJsonObject & reslut);
	
private:
	QJsonValue toJsonValue(const QVariant & value);

private:
	QString strError;

};

#endif // DATAPACKAGE_H
